﻿using System;
using System.Data;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace HRMService
{

    [ServiceContract(Namespace = "http://HRMService")]
    public interface IPremium
    {
        [OperationContract]
        DataSet Premium_GetAll();

        [OperationContract]
        DataSet Premium_GetAllByEmployeeID(int EmployeeID);

        [OperationContract]
        PremiumInfo Premium_GetInfo(int PremiumID);

        [OperationContract]
        DataSet Premium_GetList(out int ItemCount, int EmployeeID, int currentPage, int pageSize);

        [OperationContract]
        int Premium_Insert(PremiumInfo eInfo);

        [OperationContract]
        bool Premium_Update(PremiumInfo eInfo);

        [OperationContract]
        bool Premium_Delete(int PremiumID);

        [OperationContract]
        bool Premium_Exist(int _ID, string _SIBookNo, DateTime  _FromDate, DateTime  _ToDate);

        [OperationContract]
        DataSet Premium_GetBySIBookNo(string _SIBookNo, bool _IsQTBH);

        [OperationContract]
        DataSet Premium_QTBH(string Branch_Code, string SIBookNo, int opt, DateTime FromDate, DateTime ToDate, int DocumentID);

        [OperationContract]
        DataSet Premium_GetByDate(DateTime _FromDate, DateTime _ToDate, string _BranchCode, int _InToKhai, string _SIBookNo);

        [OperationContract]
        DataSet Premium_GetAmount(DateTime _FromDate, string _SIBookNo);

        [OperationContract]
        int Premium_CountMonth(string _SIBookNo);

        [OperationContract]
        decimal Premium_GetAVGAmount(DateTime _DateVal, string _SIBookNo);
    }
    [DataContract(Namespace = "http://HRMService")]
    public class PremiumInfo
    {

        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        [DataMember]
        public int EmployeeID
        {
            get { return _EmployeeID; }
            set { _EmployeeID = value; }
        }
        [DataMember]
        public DateTime FromDate
        {
            get { return _FromDate; }
            set { _FromDate = value; }
        }
        [DataMember]
        public DateTime ToDate
        {
            get { return _ToDate; }
            set { _ToDate = value; }
        }
        string _SIBookNo;
        [DataMember]
        public string SIBookNo
        {
            get { return _SIBookNo; }
            set { _SIBookNo = value; }
        }
        [DataMember]
        public string WorkUnit
        {
            get { return _WorkUnit; }
            set { _WorkUnit = value; }
        }
        string _WorkName;
        [DataMember]
        public string WorkName
        {
            get { return _WorkName; }
            set { _WorkName = value; }
        }
        [DataMember]
        public string Job
        {
            get { return _Job; }
            set { _Job = value; }
        }
        string _Type;
        [DataMember]
        public string Type
        {
            get { return _Type; }
            set { _Type = value; }
        }
        [DataMember]
        public decimal Salary
        {
            get { return _Salary; }
            set { _Salary = value; }
        }
        decimal _BasicSalary;
        [DataMember]
        public decimal BasicSalary
        {
            get { return _BasicSalary; }
            set { _BasicSalary = value; }
        }
        decimal _BasicFactor;
        [DataMember]
        public decimal BasicFactor
        {
            get { return _BasicFactor; }
            set { _BasicFactor = value; }
        }
        [DataMember]
        public decimal PositionFactor
        {
            get { return _PositionFactor; }
            set { _PositionFactor = value; }
        }
        [DataMember]
        public decimal SeniorityFactor
        {
            get { return _SeniorityFactor; }
            set { _SeniorityFactor = value; }
        }
        [DataMember]
        public decimal OverSeniorityFactor
        {
            get { return _OverSeniorityFactor; }
            set { _OverSeniorityFactor = value; }
        }
        [DataMember]
        public decimal AreaFactor
        {
            get { return _AreaFactor; }
            set { _AreaFactor = value; }
        }
        [DataMember]
        public int MonthNo
        {
            get { return _MonthNo; }
            set { _MonthNo = value; }
        }
        string _InsTypeCode;
        [DataMember]
        public string InsTypeCode
        {
            get { return _InsTypeCode; }
            set { _InsTypeCode = value; }
        }
        [DataMember]
        public string Description
        {
            get { return _Description; }
            set { _Description = value; }
        }
        bool _IsInitial;
        [DataMember]
        public bool IsInitial
        {
            get { return _IsInitial; }
            set { _IsInitial = value; }
        }
        DateTime _DateVal;
        [DataMember]
        public DateTime DateVal
        {
            get { return _DateVal; }
            set { _DateVal = value; }
        }
        #region VARIABLES

        int _ID;
        int _EmployeeID;
        DateTime _FromDate;
        DateTime _ToDate;
        string _WorkUnit;
        string _Job;
        decimal _Salary;
        decimal _PositionFactor;
        decimal _SeniorityFactor;
        decimal _OverSeniorityFactor;
        decimal _AreaFactor;
        int _MonthNo;
        string _Description;

        #endregion
    }

}
